#ifndef MYLABEL_H
#define MYLABEL_H

#include <QLabel>
#include <QObject>

static QString qss = "QLabel {   border-radius: 5px; background-color: rgb(%1);}";

class MyLabel : public QLabel {
    Q_OBJECT
public:
    MyLabel(const bool b, const QString &msg, QWidget *parent = nullptr);
    ~MyLabel();

    QSize sizeHint() const override;
protected:
    void enterEvent(QEnterEvent *) override ;
    void leaveEvent(QEvent *) override;
private:
    bool colour;
    QString _msg;

    void setSty(){
        if (colour){
            setStyleSheet(qss.arg("149,236,105"));
        }else{
            setStyleSheet(qss.arg("255,255,255"));
        }
    }
};

#endif // MYLABEL_H
